import System

import System.Process

main = do
  (f:args) <- getArgs
  runCmd ("gcc " ++ f ++ " -o temp.out") 
  runCmd ("./temp.out " ++ unwords args)

runCmd cmd = do
  ph <- runCommand cmd
  ec <- waitForProcess ph
  case ec of 
   ExitSuccess -> return ()
   _           -> error (show ec)
